function stind =sind(mat,svec) 
% function stind =sind(mat,svec); 
% State Indicators 
% Find the position at which the different elements 
% of svec are 
% Output stind =[ rows(mat) , cols(mat), length(svec) ] 
% with each page for one element 
% AJ 12/4/03 
[nr,nc]=size(mat);
ns=length(svec); 
stind=zeros(nr,nc,ns); 
ii=1; 
for ii=1:ns;
    tmat=zeros(nr,nc); 
    tmat( find(mat == svec(ii)) )=1; 
    stind(:,:,ii)=tmat; 
end; 